// ml:run = $bin < input
#include <iostream>
#include <cstring>
#include <string>

int count[39];
std::string s;

void print(int pos)
{
    std::memset(count, 0, sizeof(count));
    for (int j = 0; j < 26; j++) {
        if (s[pos + j] == '?') continue;
        count[s[pos + j] - 'A']++;
    }
    for (int j = 0; j < 26; j++) {
        if (s[pos + j] == '?') {
            for (int k = 0; k < 26; k++)
                if (!count[k]) {
                    count[k] = 1;
                    s[pos + j] = 'A' + k;
                    break;
                }
        }
    }
    for (auto & ch : s)
        if (ch == '?') ch = 'A';
    std::cout << s << "\n";
    exit(0);
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin >> s;
    int n = s.size();
    if (n < 26) {
        std::cout << "-1\n";
        return 0;
    }
    for (int i = 0; i <= n - 26; i++) {
        std::memset(count, 0, sizeof(count));
        bool ok = true;
        for (int j = 0; j < 26; j++) {
            if (s[i + j] == '?') continue;
            count[s[i + j] - 'A']++;
            if (count[s[i + j] - 'A'] > 1) {
                ok = false;
                break;
            }
        }
        if (ok) print(i);
    }
    std::cout << "-1\n";
}

